function asignarFinal(){
    $("#msn_asig_final")[0].innerHTML="<img src='media/ani-rebuild.gif'/>";

    $.ajax({
        type: "POST",
        url: "index.php?controller=revisor&action=asignarFinalAjax",
        data: $("#asignarFinalForm").serializeArray(),
        success: showMessageFinal,
        error: errFinal
    })
}

function showMessageFinal(data){
    $("#msn_asig_final")[0].innerHTML=data;
//$('#evaluacion').attr('disabled', 'disabled');
/*$(this).delay(5000,function(){
        $("#message")[0].innerHTML="";
    });*/
}

function errFinal(xhr, reason, ex){
    $("#msn_asig_final").text(reason);
}

function asignarPaper(page){
    //alert(page);
    //$(this).delay(5000,function(){alert("hola")});
    //document.evaluacionForm.evaluacion.enable=false;
    //$('#evaluacion').attr('disabled', 'disabled');
    $("#asignar_paper")[0].innerHTML="<img src='media/ani-rebuild.gif'/>";

    $.ajax({
        type: "GET",
        url: "index.php?controller=revisor&action=asignarPaperAjax&page="+page,
        data: $("#asignarPaperForm").serializeArray(),
        success: showMessagePaper,
        error: errPaper
    })
}

function showMessagePaper(data){
    $("#asignar_paper")[0].innerHTML=data;
//$('#evaluacion').attr('disabled', 'disabled');
/*$(this).delay(5000,function(){
        $("#message")[0].innerHTML="";
    });*/
}

function errPaper(xhr, reason, ex){
    $("#asignar_paper").text(reason);
}

function procesarAsignarPaper(){    
    if($("input[name=radioPaper]:checked").val()){
        valor = $("input[name=radioPaper]:checked").val();
        window.location = "index.php?controller=revisor&action=asignarRevisor&id="+valor;
    }else{
        $("#msn_asig_paper").show();        
        $("#msn_asig_paper")[0].innerHTML="<div id='asig_paper'>Debe elegir un paper</div>";
        $(this).delay(3000,function(){
            $("#msn_asig_paper").hide();
        });
    }
}

function asignarRevisor(page){
    //alert(page);
    //$(this).delay(5000,function(){alert("hola")});
    //document.evaluacionForm.evaluacion.enable=false;
    //$('#evaluacion').attr('disabled', 'disabled');
    $("#asignar_revisor")[0].innerHTML="<img src='media/ani-rebuild.gif'/>";

    $.ajax({
        type: "GET",
        url: "index.php?controller=revisor&action=asignarRevisorAjax&page="+page,
        data: $("#asignarRevisorForm").serializeArray(),
        success: showMessageRevisor,
        error: errRevisor
    })
}

function showMessageRevisor(data){
    $("#asignar_revisor")[0].innerHTML=data;
//$('#evaluacion').attr('disabled', 'disabled');
/*$(this).delay(5000,function(){
        $("#message")[0].innerHTML="";
    });*/
}

function errRevisor(xhr, reason, ex){
    $("#asignar_revisor").text(reason);
}

function procesarAsignarRevisor(){
    if($("input[name=radioRevisor]:checked").val()){
        valor = $("input[name=radioRevisor]:checked").val();
        window.location = "index.php?controller=revisor&action=procesarAsignarRevisor&id="+valor;
    }else{
        $("#msn_asig_revisor").show();
        $("#msn_asig_revisor")[0].innerHTML="<div id='asig_paper'>Debe elegir un revisor</div>";
        $(this).delay(3000,function(){
            $("#msn_asig_revisor").hide();
        });
    }
}